ifndef CROSS_COMPILE
CROSS_COMPILE = /home/mato_no1/1_Apps/mips_gcc/bin/mips-sde-elf-
endif

CC = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld
OBJCOPY = $(CROSS_COMPILE)objcopy
OBJDUMP = $(CROSS_COMPILE)objdump

OBJECTS = tempROM.o

SIZE = 0

export CROSS_COMPILE

# ********************
# Rules of Compilation
# ********************

all: tempROM.data


%.o: %.S
	$(CC) -mips32 $< -o $@

tempROM.om: ram.ld $(OBJECTS)
	$(LD) -T ram.ld $(OBJECTS) -o $@

tempROM.bin: tempROM.om
	$(OBJCOPY) -O binary $< $@

tempROM.data: tempROM.bin
	./Bin2Mem -f $< -o $@ -s $(SIZE)

clean:
	rm -f *.o *.om *.bin *.data

